package com.yoyo.yyadsdk.bean.dao;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Transient;
import org.greenrobot.greendao.annotation.Unique;

@Entity
public class PullEntity implements Parcelable {

    /**
     * type : 1 拉活类型 {@link com.yoyo.yyadsdk.config.PullFeature}
     * tPkg : "com.dollkey.waveview" 目标应用
     * action : com.app.hubert.newbieguide 拉活链接
     * inactivity : 0 目标应用多久没有活跃才拉活，单位：秒
     * frequency : 100 该类型任务拉活总次数
     * pullTimes : 0 该类型任务当天内(周期内)的拉活次数
     * priority : 100 优先级
     * startTime : 1557042403000 开始生效时间
     * endTime : 1557247603000 生效结束时间
     * duringStartTime : 0000 当日内的开始时间(HHmm)
     * duringEndTime : 2400 当日内的结束时间(HHmm)
     * isBackHome : true 是否退入后台
     * allowDiscover : false 是否允许用户发现
     * ruleId : 0 黑白名单规则id
     */

    @Id(autoincrement = true)
    private Long _id;
    @Unique
    private int id;
    private int type;
    private String action;
    @SerializedName("tpkg")
    private String tPkg;
    @SerializedName("inactivity")
    private long inActivity;
    private int frequency;
    private int pullTimes;
    private int priority;
    private long startTime;
    private long endTime;
    private String duringStartTime;
    private String duringEndTime;
    private int isBackHome;
    private int ruleId;
    private int monitorTimeId;
    private int allowDiscover;
    @Generated(hash = 279061625)
    public PullEntity(Long _id, int id, int type, String action, String tPkg,
            long inActivity, int frequency, int pullTimes, int priority,
            long startTime, long endTime, String duringStartTime,
            String duringEndTime, int isBackHome, int ruleId, int monitorTimeId,
            int allowDiscover) {
        this._id = _id;
        this.id = id;
        this.type = type;
        this.action = action;
        this.tPkg = tPkg;
        this.inActivity = inActivity;
        this.frequency = frequency;
        this.pullTimes = pullTimes;
        this.priority = priority;
        this.startTime = startTime;
        this.endTime = endTime;
        this.duringStartTime = duringStartTime;
        this.duringEndTime = duringEndTime;
        this.isBackHome = isBackHome;
        this.ruleId = ruleId;
        this.monitorTimeId = monitorTimeId;
        this.allowDiscover = allowDiscover;
    }
    @Generated(hash = 1309776129)
    public PullEntity() {
    }
    public Long get_id() {
        return this._id;
    }
    public void set_id(Long _id) {
        this._id = _id;
    }
    public int getId() {
        return this.id;
    }
    public void setId(int id) {
        this.id = id;
    }
    public int getType() {
        return this.type;
    }
    public void setType(int type) {
        this.type = type;
    }
    public String getAction() {
        return this.action;
    }
    public void setAction(String action) {
        this.action = action;
    }
    public String getTPkg() {
        return this.tPkg;
    }
    public void setTPkg(String tPkg) {
        this.tPkg = tPkg;
    }
    public long getInActivity() {
        return this.inActivity;
    }
    public void setInActivity(long inActivity) {
        this.inActivity = inActivity;
    }
    public int getFrequency() {
        return this.frequency;
    }
    public void setFrequency(int frequency) {
        this.frequency = frequency;
    }
    public int getPullTimes() {
        return this.pullTimes;
    }
    public void setPullTimes(int pullTimes) {
        this.pullTimes = pullTimes;
    }
    public int getPriority() {
        return this.priority;
    }
    public void setPriority(int priority) {
        this.priority = priority;
    }
    public long getStartTime() {
        return this.startTime;
    }
    public void setStartTime(long startTime) {
        this.startTime = startTime;
    }
    public long getEndTime() {
        return this.endTime;
    }
    public void setEndTime(long endTime) {
        this.endTime = endTime;
    }
    public String getDuringStartTime() {
        return this.duringStartTime;
    }
    public void setDuringStartTime(String duringStartTime) {
        this.duringStartTime = duringStartTime;
    }
    public String getDuringEndTime() {
        return this.duringEndTime;
    }
    public void setDuringEndTime(String duringEndTime) {
        this.duringEndTime = duringEndTime;
    }
    public int getIsBackHome() {
        return this.isBackHome;
    }
    public void setIsBackHome(int isBackHome) {
        this.isBackHome = isBackHome;
    }
    public int getRuleId() {
        return this.ruleId;
    }
    public void setRuleId(int ruleId) {
        this.ruleId = ruleId;
    }
    public int getMonitorTimeId() {
        return this.monitorTimeId;
    }
    public void setMonitorTimeId(int monitorTimeId) {
        this.monitorTimeId = monitorTimeId;
    }
    public int getAllowDiscover() {
        return this.allowDiscover;
    }
    public void setAllowDiscover(int allowDiscover) {
        this.allowDiscover = allowDiscover;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(this._id);
        dest.writeInt(this.id);
        dest.writeInt(this.type);
        dest.writeString(this.action);
        dest.writeString(this.tPkg);
        dest.writeLong(this.inActivity);
        dest.writeInt(this.frequency);
        dest.writeInt(this.pullTimes);
        dest.writeInt(this.priority);
        dest.writeLong(this.startTime);
        dest.writeLong(this.endTime);
        dest.writeString(this.duringStartTime);
        dest.writeString(this.duringEndTime);
        dest.writeInt(this.isBackHome);
        dest.writeInt(this.ruleId);
        dest.writeInt(this.monitorTimeId);
        dest.writeInt(this.allowDiscover);
    }

    protected PullEntity(Parcel in) {
        this._id = (Long) in.readValue(Long.class.getClassLoader());
        this.id = in.readInt();
        this.type = in.readInt();
        this.action = in.readString();
        this.tPkg = in.readString();
        this.inActivity = in.readLong();
        this.frequency = in.readInt();
        this.pullTimes = in.readInt();
        this.priority = in.readInt();
        this.startTime = in.readLong();
        this.endTime = in.readLong();
        this.duringStartTime = in.readString();
        this.duringEndTime = in.readString();
        this.isBackHome = in.readInt();
        this.ruleId = in.readInt();
        this.monitorTimeId = in.readInt();
        this.allowDiscover = in.readInt();
    }

    public static final Parcelable.Creator<PullEntity> CREATOR = new Parcelable.Creator<PullEntity>() {
        @Override
        public PullEntity createFromParcel(Parcel source) {
            return new PullEntity(source);
        }

        @Override
        public PullEntity[] newArray(int size) {
            return new PullEntity[size];
        }
    };
}
